revNumberOfRecords
Type
function
Summary
Returns the number of records in a record set.
Syntax
revNumberOfRecords(<recordSetID>)
Description
Use the revNumberOfRecords function to find out how many records matched a query.
If the query is not successful, the revNumberOfRecords function returns an error message that begins with the string "revdberr".
Some database types do not support returning the number of records in a result set. One example of this is ODBC data sources with forward-only cursors. If the database does not support this feature, the revNumberOfRecords function will return -1.
The revGetDatabaseDriverPath function is part of the Database library. To ensure that the function works in a standalone application, you must include this custom library when you create your standalone. In the Inclusions pane of the Standalone Application Settings window, make sure the "Database" library checkbox is checked.
Parameters
Name | Type | Description |
---|---|---|
recordSetID | The number returned by the revQueryDatabase function when the record set was created. |
Examples
revNumberOfRecords(westCoastCustomers)
get revNumberOfRecords(15) -- number of records in record set 15
repeat for revNumberOfRecords(pastDueCustomers) times
Related
command: revMoveToNextRecord
glossary: Standalone Application Settings, record, standalone application, record set, return, SQL query, LiveCode custom library, function
keyword: string
library: Database library
Compatibility and Support
Introduced
LiveCode 1.1
OS
mac
windows
linux
ios
android
Platforms
desktop
server
mobile